package com.wei.controller;

import com.wei.pojo.Order;
import com.wei.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping("/{id}")
    public Order searchOrderById(@PathVariable("id") Integer id) {
        return orderService.selectOrderById(id);
    }


    @GetMapping("/index")
    public String func1() {
        return "index";
    }
}
